package cn.yuanqiao.manage.domain;

import cn.yuanqiao.common.annotation.IdAnnotation;
import cn.yuanqiao.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * 管理员信息对象 MANAGE_USER
 *
 * @author yuanqiao
 * @date 2023-06-06
 */
public class ManageUser extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @IdAnnotation
    @JsonFormat(shape = JsonFormat.Shape.STRING)//转化成string传到前端
    private Long id;

    @NotBlank(message = "用户名不能为空")
    @Size(min = 0, max = 50, message = "用户名长度不能超过25个汉字")
    private String userName;

    @NotBlank(message = "登录账号不能为空")
    @Size(min = 0, max = 100, message = "登录账号长度不能超过100个字符")
    private String loginName;

    @Size(min = 0, max = 100, message = "描述长度不能超过50个汉字")
    private String remark;

    @NotBlank(message = "密码不能为空")
    @Size(min = 0, max = 200, message = "密码长度不能超过200个字符")
    private String passWord;

        /**
         * 用户头像
         */
        private String avatar;

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getPassWord() {
        return passWord;
    }

    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    @Override
    public String getRemark() {
        return remark;
    }

    @Override
    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("ID", getId())
                .append("USERNAME", getUserName())
                .append("LOGINNAME", getLoginName())
                .append("REMARK", getRemark())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("avatar", getAvatar())
                .toString();
    }
}
